home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-18 | 22.0 KB | 1,218 lines |
- head 0.19;
- access;
- symbols;
- locks; strict;
- comment @# @;
-
-
- 0.19
- date 92.04.18.01.11.50; author dennisg; state Exp;
- branches;
- next 0.18;
-
- 0.18
- date 92.04.18.00.43.06; author dennisg; state Exp;
- branches;
- next 0.17;
-
- 0.17
- date 92.04.13.11.43.08; author dennisg; state Exp;
- branches;
- next 0.16;
-
- 0.16
- date 92.02.25.11.16.03; author dennisg; state Exp;
- branches;
- next 0.15;
-
- 0.15
- date 92.01.03.02.55.03; author dennisg; state Exp;
- branches;
- next 0.14;
-
- 0.14
- date 91.12.31.20.13.03; author dennisg; state Exp;
- branches;
- next 0.13;
-
- 0.13
- date 91.12.10.12.04.55; author dennisg; state Exp;
- branches;
- next 0.12;
-
- 0.12
- date 91.12.07.00.49.28; author dennisg; state Exp;
- branches;
- next 0.11;
-
- 0.11
- date 91.12.06.00.35.05; author dennisg; state Exp;
- branches;
- next 0.10;
-
- 0.10
- date 91.11.30.14.19.18; author dennisg; state Exp;
- branches;
- next 0.9;
-
- 0.9
- date 91.11.29.21.59.32; author dennisg; state Exp;
- branches;
- next 0.8;
-
- 0.8
- date 91.11.29.20.01.29; author dennisg; state Exp;
- branches;
- next 0.7;
-
- 0.7
- date 91.11.29.14.09.51; author dennisg; state Exp;
- branches;
- next 0.6;
-
- 0.6
- date 91.11.26.02.45.16; author dennisg; state Exp;
- branches;
- next 0.5;
-
- 0.5
- date 91.11.20.02.06.30; author dennisg; state Exp;
- branches;
- next 0.4;
-
- 0.4
- date 91.11.19.12.37.24; author dennisg; state Exp;
- branches;
- next 0.3;
-
- 0.3
- date 91.11.16.13.32.58; author dennisg; state Exp;
- branches;
- next 0.2;
-
- 0.2
- date 91.11.07.22.30.54; author dennisg; state Exp;
- branches;
- next 0.1;
-
- 0.1
- date 91.10.24.00.45.39; author dennisg; state Exp;
- branches;
- next ;
-
-
- desc
- @This is the implementation file for class Object.
- Much of its functionality was coded from descriptions
- contained within the NeXT technical documentation and
- from "Object-Oriented Programming", Second Edition, by
- Cox and Novobilski.
- @
-
-
- 0.19
- log
- @changes some name accesses to use functions.
- @
- text
- @/* -*-c-*-
- * This file contains the implementation of class Object.
- *
- * Copyright (C) 1991 Threaded Technologies Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 1, or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should receive a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/dispatch.common/RCS/Object.m,v 0.18 1992/04/18 00:43:06 dennisg Exp dennisg $
- $Author: dennisg $
- $Date: 1992/04/18 00:43:06 $
- $Log: Object.m,v $
- # Revision 0.18 1992/04/18 00:43:06 dennisg
- # Changed -hash.
- # It returned 'self' casted to a unsigned int.
- #
- # Revision 0.17 1992/04/13 11:43:08 dennisg
- # Check in after array version of run-time works.
- # Expect more changes as hash version and other changes are made.
- #
- # Revision 0.16 1992/02/25 11:16:03 dennisg
- # ??? I lost track.
- #
- # Revision 0.15 1992/01/03 02:55:03 dennisg
- # modified to handle new initialization scheme.
- # fixed code structure.
- #
- # Revision 0.14 1991/12/31 20:13:03 dennisg
- # Deleted index variable stuff. Index variables are a hack to the language.
- #
- # Revision 0.13 1991/12/10 12:04:55 dennisg
- # Cleaned up file format for a distribution.
- #
- # Revision 0.12 1991/12/07 00:49:28 dennisg
- # deleted +description:.
- #
- # Revision 0.11 1991/12/06 00:35:05 dennisg
- # deleted perform:with:: method.
- # changes the other perform: methods to use objc_msgSend() correctly.
- #
- # Revision 0.10 1991/11/30 14:19:18 dennisg
- # implemented archiving.
- #
- # Revision 0.9 1991/11/29 21:59:32 dennisg
- # modified to implement set functions.
- #
- # Revision 0.8 1991/11/29 20:01:29 dennisg
- # fixed several const decls. bozo.
- #
- # Revision 0.7 1991/11/29 14:09:51 dennisg
- # changed some methods to implement functions contained in the core code.
- #
- # Revision 0.6 1991/11/26 02:45:16 dennisg
- # commiting a copy of the source to rcs before i implement
- # changes to fix posing.
- #
- # Revision 0.5 1991/11/20 02:06:30 dennisg
- # returned doesNotRecognize:
- #
- # Revision 0.4 1991/11/19 12:37:24 dennisg
- # minr changes. still in a state of flux.
- #
- # Revision 0.3 1991/11/16 13:32:58 dennisg
- # changed #import statements to #include.
- # this should make gcc2 happy -- geez.
- #
- # Revision 0.2 1991/11/07 22:30:54 dennisg
- # added copyleft
- #
- # Revision 0.1 1991/10/24 00:45:39 dennisg
- # Initial check in. Preliminary development stage.
- #
- */
-
-
- #include <Object.h>
- #include <objc-proto.h>
- #include <objc-protoP.h>
-
- #include <errno.h>
- #include <stdarg.h>
- #include <stdlib.h>
-
-
- #define CLASS( class ) (( Class_t )class )
-
-
- @@implementation Object
-
-
- + new {
-
-
- return class_createInstance( CLASS( self ));
- }
-
-
- + free { return nil; }
- - free { return object_dispose( self ); }
-
-
- - copy { return [ self shallowCopy ]; }
-
-
- - shallowCopy {
-
-
- return object_copy ( self );
- }
-
-
- - deepCopy {
-
-
- return class_createInstance ([ self class ]);
- }
-
-
- + ( Class_t )class { return CLASS( self ); }
- + ( Class_t )superClass { return CLASS( self )->super_class; }
- - ( Class_t )class { return isa; }
- - ( Class_t )superClass { return isa->super_class; }
- - ( const char * )name { return object_getClassName (self); }
- - self { return self; }
-
-
- - ( u_int )hash {
-
-
- return ( u_int )self; /* gak! Not portable. */
- }
-
-
- - ( BOOL )isEqual:anObject {
-
-
- return self == anObject ;
- }
-
-
- - ( BOOL )isKindOf:( Class_t )aClassObject {
-
-
- return [ self isKindOfGivenName:class_getClassName (aClassObject)];
- }
-
-
- - ( BOOL )isMemberOf:( Class_t )aClassObject {
-
-
- return isa == aClassObject ;
- }
-
-
- - ( BOOL )isKindOfGivenName:( const char* )aClassName {
-
- Class_t class;
-
-
- for( class = isa; class; class = class->super_class )
- if( !strcmp( class_getClassName (class), aClassName ))
- return YES;
-
- return NO;
- }
-
-
- - ( BOOL )isMemberOfGivenName:( const char* )aClassName {
-
-
- return !strcmp([ self name ], aClassName );
- }
-
-
- + ( BOOL )instancesRespondTo:( SEL )aSel {
-
-
- if( class_getInstanceMethod( CLASS( self ), aSel ))
- return YES;
-
- return NO;
- }
-
-
- - ( BOOL )respondsTo:( SEL )aSel {
-
-
- if( class_getInstanceMethod( isa, aSel ))
- return YES;
-
- return NO;
- }
-
-
- - perform:( SEL )aSel {
-
-
- return (*((IMP)objc_msgSend( self, aSel )))(self, aSel);
- }
-
-
- - perform:( SEL )aSel with:aObject {
-
-
- return (*((IMP)objc_msgSend( self, aSel )))(self, aSel, aObject);
- }
-
-
- + poseAs:( Class_t )aClassObject {
-
-
- return class_poseAs (self, aClassObject);
- }
-
-
- - subclassResponsibility:( SEL )aSel {
-
-
- return [ self error:"subclass should override %s", aSel ];
- }
-
-
- - notImplemented:(SEL)aSel {
-
-
- return [ self error:"method %s not implemented", aSel ];
- }
-
-
- - doesNotRecognize:( SEL )aSel {
-
-
- return [ self error:"%s does not recognize %s", [ self name ], aSel ];
- }
-
- - error:( const char* )aString, ... {
-
- #define FMT "error: %s (instance)\n%s\n"
-
- char fmt[ strlen (FMT) +
- strlen (isa->name) +
- strlen (aString) + 8 ];
- va_list ap;
-
-
- sprintf (fmt, FMT, isa->name, aString);
- va_start (ap, aString);
- (*_error)(self, fmt, ap);
- va_end (ap);
-
- #undef FMT
- return self;
- }
-
-
- + error:( const char* )aString, ... {
-
- #define FMT "error: %s (class)\n%s\n"
-
- char fmt[ strlen (FMT) +
- strlen (isa->name) +
- strlen (aString) + 8 ];
- va_list ap;
-
-
- sprintf (fmt, FMT, isa->name, aString);
- va_start (ap, aString);
- (*_error)(self, fmt, ap);
- va_end (ap);
-
- #undef FMT
- return self;
- }
-
-
- - storeOn:( int )aFd {
-
- int len;
- long version = [[ self class ] version ];
-
-
- if ((len = write (aFd, "#", strlen ("#"))) != -1)
- if ((len = write (aFd, [ self name ], strlen ([ self name ]) + 1)) != -1)
- len = write (aFd, &version, sizeof (version));
-
- if (len == -1)
- [ self error:"error passivating object, errno=%d", errno ];
-
- return self;
- }
-
-
- + readFrom:( int )aFd {
-
- id aObj = nil;
- char objName[256];
- int len;
-
-
- if ((len = read (aFd, &objName, strlen ("#"))) != -1)
- if (objName[0] == '#') {
- long version;
- int i = 0;
-
- /* Read the object's class. */
- do {
- len = read (aFd, &objName[i], sizeof (char));
- } while (objName[ i++ ] && (len != -1));
-
- /* Get its version. */
- if (len != -1)
- len = read (aFd, &version, sizeof (version));
-
- /* No errors???
- Then create a object. */
- if (len != -1) {
- aObj = class_createInstance (objc_getClass (objName));
-
- /* If the object was
- successfully created then
- tell it to dearchive
- itself. */
- if (aObj)
- [ aObj readFrom:aFd ];
- }
- }
-
- if (len == -1)
- [ self error:"error activating object, errno=%d", errno ];
-
- return aObj;
- }
-
-
- - readFrom:( int )aFd { return self; }
-
-
- + ( int )version {
-
-
- return class_getVersion (CLASS (self));
- }
-
-
- + setVersion:( int )aVersion {
-
-
- class_setVersion (CLASS (self), aVersion);
-
- return self;
- }
-
-
- @@end
-
-
- @
-
-
- 0.18
- log
- @Changed -hash.
- It returned 'self' casted to a unsigned int.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/dispatch.common/RCS/Object.m,v 0.17 1992/04/13 11:43:08 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1992/04/13 11:43:08 $
- d23 4
- d154 1
- a154 1
- return [ self isKindOfGivenName:aClassObject->name ];
- d171 1
- a171 1
- if( !strcmp( class->name, aClassName ))
- @
-
-
- 0.17
- log
- @Check in after array version of run-time works.
- Expect more changes as hash version and other changes are made.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/common/RCS/Object.m,v 0.16 1992/02/25 11:16:03 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1992/02/25 11:16:03 $
- d23 4
- d136 1
- a136 2
- /* Cast the return value to prevent a compiler warning. */
- return ( u_int )[ self subclassResponsibility:_cmd ];
- @
-
-
- 0.16
- log
- @??? I lost track.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.15 1992/01/03 02:55:03 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1992/01/03 02:55:03 $
- d23 3
- d79 2
- a80 2
- #include <ObjC-proto.h>
- #include <ObjC-proto-private.h>
- a320 1
- aObj = object_realloc (aObj, objc_classSize (aObj));
- @
-
-
- 0.15
- log
- @modified to handle new initialization scheme.
- fixed code structure.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.14 1991/12/31 20:13:03 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/12/31 20:13:03 $
- d23 4
- a77 1
- #include <hash.h>
- @
-
-
- 0.14
- log
- @Deleted index variable stuff. Index variables are a hack to the language.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.13 1991/12/10 12:04:55 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/12/10 12:04:55 $
- d23 3
- a76 1
- #include <libc.h>
- d78 1
- d126 1
- a126 1
- /* Cast the return value to prevent a compiler warning. */
- @
-
-
- 0.13
- log
- @Cleaned up file format for a distribution.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.12 1991/12/07 00:49:28 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/12/07 00:49:28 $
- d23 3
- d73 1
- d87 1
- a87 1
- return class_createInstance( CLASS( self ), [ self ndxVarSize ]);
- d101 1
- a101 1
- return object_copy (self, [[ self class ] ndxVarSize ]);
- d108 1
- a108 1
- return class_createInstance ([ self class ], [[ self class ] ndxVarSize ]);
- d123 2
- a124 1
- return [ self subclassResponsibility:_cmd ];
- d311 2
- a312 3
- aObj = class_createInstance
- ( objc_getClass (objName), 0);
- aObj = object_realloc (aObj, [[ aObj class ] ndxVarSize ]);
- a347 3
-
- - ( u_int )capacity { return 0; }
- + ( int )ndxVarSize { return 0; }
- @
-
-
- 0.12
- log
- @deleted +description:.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.11 1991/12/06 00:35:05 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/12/06 00:35:05 $
- d23 3
- d87 2
- a88 2
- + free { return nil; }
- - free { return object_dispose( self ); }
- d91 1
- a91 1
- - copy { return [ self shallowCopy ]; }
- d108 6
- a113 6
- + ( Class_t )class { return CLASS( self ); }
- + ( Class_t )superClass { return CLASS( self )->super_class; }
- - ( Class_t )class { return isa; }
- - ( Class_t )superClass { return isa->super_class; }
- - ( const char * )name { return object_getClassName (self); }
- - self { return self; }
- d133 1
- a133 1
- return [ self isKindOfGivenName:aClassObject->name ];
- d186 2
- a187 2
-
- return (*((IMP)objc_msgSend( self, aSel )))(self, aSel);
- d193 2
- a194 2
-
- return (*((IMP)objc_msgSend( self, aSel )))(self, aSel, aObject);
- d208 1
- a208 1
- return [ self error:"subclass should override %s", aSel ];
- d215 1
- a215 1
- return [ self error:"method %s not implemented", aSel ];
- d227 1
- a227 1
- #define FMT "error: %s (instance)\n%s\n"
- d229 3
- a231 3
- char fmt[ strlen (FMT) +
- strlen (isa->name) +
- strlen (aString) + 8 ];
- d235 1
- a235 1
- sprintf (fmt, FMT, isa->name, aString);
- d237 1
- a237 1
- (*_error)(self, fmt, ap);
- d247 1
- a247 1
- #define FMT "error: %s (class)\n%s\n"
- d249 3
- a251 3
- char fmt[ strlen (FMT) +
- strlen (isa->name) +
- strlen (aString) + 8 ];
- d255 1
- a255 1
- sprintf (fmt, FMT, isa->name, aString);
- d257 1
- a257 1
- (*_error)(self, fmt, ap);
- d267 10
- a276 10
- int len;
- long version = [[ self class ] version ];
-
-
- if ((len = write (aFd, "#", strlen ("#"))) != -1)
- if ((len = write (aFd, [ self name ], strlen ([ self name ]) + 1)) != -1)
- len = write (aFd, &version, sizeof (version));
-
- if (len == -1)
- [ self error:"error passivating object, errno=%d", errno ];
- d284 38
- a321 38
- id aObj = nil;
- char objName[256];
- int len;
-
-
- if ((len = read (aFd, &objName, strlen ("#"))) != -1)
- if (objName[0] == '#') {
- long version;
- int i = 0;
-
- /* Read the object's class. */
- do {
- len = read (aFd, &objName[i], sizeof (char));
- } while (objName[ i++ ] && (len != -1));
-
- /* Get its version. */
- if (len != -1)
- len = read (aFd, &version, sizeof (version));
-
- /* No errors???
- Then create a object. */
- if (len != -1) {
- aObj = class_createInstance
- ( objc_getClass (objName), 0);
- aObj = object_realloc (aObj, [[ aObj class ] ndxVarSize ]);
-
- /* If the object was
- successfully created then
- tell it to dearchive
- itself. */
- if (aObj)
- [ aObj readFrom:aFd ];
- }
- }
-
- if (len == -1)
- [ self error:"error activating object, errno=%d", errno ];
-
- d326 1
- a326 1
- - readFrom:( int )aFd { return self; }
- d332 1
- a332 1
- return class_getVersion (CLASS (self));
- d339 2
- a340 2
- class_setVersion (CLASS (self), aVersion);
-
- d345 2
- a346 2
- - ( u_int )capacity { return 0; }
- + ( int )ndxVarSize { return 0; }
- @
-
-
- 0.11
- log
- @deleted perform:with:: method.
- changes the other perform: methods to use objc_msgSend() correctly.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.10 1991/11/30 14:19:18 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/30 14:19:18 $
- d23 4
- a343 1
- + ( STR )describe { return ""; }
- @
-
-
- 0.10
- log
- @implemented archiving.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.9 1991/11/29 21:59:32 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/29 21:59:32 $
- d23 3
- d179 2
- a180 2
-
- return objc_msgSend( self, aSel );
- d184 1
- a184 1
- - perform:( SEL )aSel with:anObject {
- d186 2
- a187 9
-
- return objc_msgSend( self, aSel, anObject );
- }
-
-
- - perform:( SEL )aSel with:object1 with:object2 {
-
-
- return objc_msgSend( self, aSel, object1, object2 );
- @
-
-
- 0.9
- log
- @modified to implement set functions.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.8 1991/11/29 20:01:29 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/29 20:01:29 $
- d23 3
- d73 1
- a73 1
- return class_createInstance( CLASS( self ), 0 );
- d77 2
- a78 1
- + free {
- d81 1
- a81 2
- return nil;
- }
- d84 1
- a84 1
- - free {
- d87 1
- a87 1
- return object_dispose( self );
- a90 13
- - copy {
-
-
- return [ self shallowCopy ];
- }
-
-
- - shallowCopy {
-
- return object_copy (self, 0);
- }
-
-
- d94 1
- a94 1
- return class_createInstance( isa, 0 );
- d98 6
- a103 1
- + ( Class_t )class {
- a104 3
-
- return CLASS( self );
- }
- a105 36
-
- + ( Class_t )superClass {
-
-
- return CLASS( self )->super_class;
- }
-
-
- - ( Class_t )class {
-
-
- return isa;
- }
-
-
- - ( Class_t )superClass {
-
-
- return isa->super_class;
- }
-
-
- - ( const char * )name {
-
-
- return object_getClassName (self);
- }
-
-
- - self {
-
-
- return self;
- }
-
-
- d262 1
- a262 1
- - awake {
- d264 10
- d279 1
- a279 1
- - write:( int)aFd {
- d281 39
- a319 2
-
- return [ self notImplemented:_cmd ];
- d323 1
- a323 1
- - read:( int )aFd {
- a325 4
- return [ self notImplemented:_cmd ];
- }
-
-
- d341 4
- @
-
-
- 0.8
- log
- @fixed several const decls. bozo.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.7 1991/11/29 14:09:51 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/29 14:09:51 $
- d23 3
- a56 1
- #include <memory.h>
- d84 1
- a84 1
- return class_destroyInstance( self );
- d97 1
- a97 6
- id aCopy = class_createInstance( isa, 0 );
-
-
- memcpy( aCopy, self, isa->instance_size );
-
- return aCopy;
- d268 5
- d276 4
- a279 5
- va_start( ap, aString );
- fprintf( stderr, "error: %s (instance)\n", isa->name);
- vfprintf( stderr, aString, ap );
- fprintf( stderr, "\n" );
- va_end( ap );
- d281 1
- a281 2
- abort();
-
- d288 5
- d296 4
- a299 5
- va_start( ap, aString );
- fprintf( stderr, "error: %s (class)\n", isa->name);
- vfprintf( stderr, aString, ap );
- fprintf( stderr, "\n" );
- va_end( ap );
- d301 1
- a301 2
- abort();
-
- @
-
-
- 0.7
- log
- @changed some methods to implement functions contained in the core code.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.6 1991/11/26 02:45:16 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/26 02:45:16 $
- d23 3
- d181 1
- a181 1
- - ( BOOL )isKindOfGivenName:( STR )aClassName {
- d194 1
- a194 1
- - ( BOOL )isMemberOfGivenName:( STR )aClassName {
- d269 1
- a269 1
- - error:( STR )aString, ... {
- d286 1
- a286 1
- + error:( STR )aString, ... {
- @
-
-
- 0.6
- log
- @commiting a copy of the source to rcs before i implement
- changes to fix posing.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.5 1991/11/20 02:06:30 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/20 02:06:30 $
- d23 4
- d324 1
- a324 1
- return CLASS( objc_getClass( class_getClassName( CLASS( self ))))->version;
- d331 2
- a332 3
- CLASS( objc_getClass( class_getClassName( CLASS( self ))))->version =
- aVersion;
-
- @
-
-
- 0.5
- log
- @returned doesNotRecognize:
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.4 1991/11/19 12:37:24 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/19 12:37:24 $
- d23 3
- d135 1
- a135 1
- return isa->name;
- d238 1
- a238 1
- return [ self notImplemented:_cmd ];
- @
-
-
- 0.4
- log
- @minr changes. still in a state of flux.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.3 1991/11/16 13:32:58 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/16 13:32:58 $
- d23 3
- d252 6
- @
-
-
- 0.3
- log
- @changed #import statements to #include.
- this should make gcc2 happy -- geez.
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.2 1991/11/07 22:30:54 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/11/07 22:30:54 $
- d23 4
- d37 1
- a37 1
- #include <ObjC-proto-hack.h>
- d75 7
- d91 7
- d108 1
- a108 4
- if( CLASS( self )->super_class )
- objc_getClass( CLASS( self )->super_class );
- else
- return nil;
- d150 1
- a150 1
- return ( self == anObject );
- d157 1
- a157 4
- if( aClassObject )
- return [ self isKindOfGivenName:class_getClassName( aClassObject )];
- else
- return nil;
- d173 2
- a174 2
- for( class = isa; class; class = objc_getClass( class->super_class ))
- if( !strcmp( class_getClassName( class ), aClassName ))
- a207 33
- - ( IMP )methodFor:( SEL )aSel {
-
- Method_t theMethod;
-
-
- theMethod = class_getInstanceMethod( self->isa, aSel );
-
- if( theMethod )
- return theMethod->method_imp;
- else
- [ self error:"%s: does not respond to \"%s\".", [ self name ], aSel ];
-
- return NULL;
- }
-
-
- + ( IMP )instanceMethodFor:( SEL )aSel {
-
- Method_t theMethod;
-
-
- theMethod = class_getInstanceMethod( CLASS( self ), aSel );
-
- if( theMethod )
- return theMethod->method_imp;
- else
- [ self error:"%s does not respond to %s.",
- class_getClassName( CLASS( self )), aSel ];
-
- return NULL;
- }
-
-
- d239 1
- a239 2
- return [ self error:" %s: Subclass should override message \"%s\".",
- [ self name ], aSel ];
- d246 1
- a246 2
-
- return [ self error:"%s: hasn't implemented \"%s\".", [ self name ], aSel ];
- a249 7
- - doesNotRecognize:( SEL )aSel {
-
-
- return [ self error:"%s: does not recognize \"%s\".", [ self name ], aSel ];
- }
-
-
- d256 1
- a256 1
- fprintf( stderr, "instance %s: incurred an error.\n", [ self name ]);
- d260 3
- a262 1
-
- d273 1
- a273 2
- fprintf( stderr, "class %s: incurred an error.\n",
- class_getClassName( CLASS( self )));
- d278 2
- d308 1
- a308 1
- return _objc_getClass( class_getClassName( CLASS( self )))->version;
- d315 2
- a316 1
- _objc_getClass( class_getClassName( CLASS( self )))->version = aVersion;
- @
-
-
- 0.2
- log
- @added copyleft
- @
- text
- @d19 1
- a19 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/lib/RCS/Object.m,v 0.1 1991/10/24 00:45:39 dennisg Exp dennisg $
- d21 1
- a21 1
- $Date: 1991/10/24 00:45:39 $
- d23 3
- d32 4
- a35 4
- #import <Object.h>
- #import <ObjC-proto-hack.h>
- #import <ObjC-proto-private.h>
- #import <hash.h>
- d37 3
- a39 3
- #import <memory.h>
- #import <libc.h>
- #import <stdarg.h>
- @
-
-
- 0.1
- log
- @Initial check in. Preliminary development stage.
- @
- text
- @d4 22
- a25 4
- $Header$
- $Author$
- $Date$
- $Log$
- d132 1
- a132 1
- return [ self subclassResponsibility:_cmd ];
- @
-